#include <iostream>

using namespace std;

typedef int BlopexInt;
typedef struct {double real, imag;} komplex;

extern "C"{
//void zdotc_(komplex *pres,BlopexInt *n,komplex *x,BlopexInt *incx,komplex *y,BlopexInt *incy);
//void zdotc_(BlopexInt *n,komplex *x,BlopexInt *incx,komplex *y,BlopexInt *incy, komplex *pres);
#include <cblas.h>

}


int main(int argc, char ** argv){
  int size= 100;
  komplex *a, *b;
  komplex c;
  int ONE = 1;

  a = (komplex*)malloc(sizeof(komplex)*size);
  b = (komplex*)malloc(sizeof(komplex)*size);
 

  for(int i = 0; i < size; i++){
    a[i].real = 1.0;
    a[i].imag = -1.0;
    b[i].real = 1.0;
    b[i].imag = 1.0;
  } 
//  zdotc_( &size, a, &ONE, b, &ONE, &c);
  cblas_zdotc_sub(size, a, 1, b, 1, &c);
  cout << "c.real = " << c.real << endl;
  cout << "c.imag = " << c.imag << endl;
   
  free(a);
  free(b);
}
